﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApplicationWithGrid
{
    /// <summary>
    /// Interaction logic for Dialog.xaml
    /// </summary>
    public partial class Dialog : Window
    {
        public Dialog()
        {
            InitializeComponent();
        }

        public Dialog(Boolean flag, String value)
        {
            InitializeComponent();
            if (flag)
            {//Add
                this.Title = "Add new URL";
            }
            else
            {
                this.Title = "Edit URL";
                this.textBlock_input.Text = value;
            }
        }

        public string getURL()
        {
            return this.textBlock_input.Text;
        }

        private void button_OK_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }
    }
}
